package com.clutch.student.Fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.clutch.student.Add_student_info;
import com.clutch.student.Dao.StudentDao;
import com.clutch.student.Dao.UserDao;
import com.clutch.student.EditCheck;
import com.clutch.student.Entity.Student;
import com.clutch.student.LoginActivity;
import com.clutch.student.MyApplication;
import com.clutch.student.MySourseActivity;
import com.clutch.student.R;
import com.clutch.student.ThirdRragment2Activity;

/**
 * Created by clutchyu on 2018/3/29.
 * 以管理员身份登入系统的第三个界面，添加学生
 */

public class ManagerThirdFragment extends Fragment {
    static Context context = MyApplication.getInstance();
    private EditText id;
    private EditText name;
    private RadioButton mMaleRb;
    private RadioButton mFamaleRb;
    private EditText age;
    private EditText phone;
    public ManagerThirdFragment() {
    }

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_manager_third, container, false);

        return view;
    }


    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        //控件
        RelativeLayout rl_course;
        RelativeLayout rl_skin;
        RelativeLayout re_logout;

        //控件ID
        rl_course = (RelativeLayout) getActivity().findViewById(R.id.rl_course);
        rl_skin = (RelativeLayout) getActivity().findViewById(R.id.rl_skin);
        re_logout = (RelativeLayout) getActivity().findViewById(R.id.rl_logout);

        //我的课程
        rl_course.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(),Add_student_info.class);
                startActivity(intent);
            }
        });

        //个人信息
        rl_skin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), ThirdRragment2Activity.class);
                startActivity(intent);

            }
        });
        //退出登录
        re_logout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), LoginActivity.class);
                startActivity(intent);
                getActivity().finish();
            }
        });



    }



}